package com.gxa.weixing.core.exception;


import com.gxa.weixing.core.common.ExceptionCode;

/**
 * 自定义的异常类，通过异常的枚举类型来创建
 *
 * @author YXQ
 * @date 2021/10/25 20:30
 */
public class BusinessException extends Exception {
    /**
     * 枚举类型,内含状态码code和信息msg
     */
    private final ExceptionCode exceptionCode;

    public ExceptionCode getExceptionCode() {
        return exceptionCode;
    }

    public BusinessException(ExceptionCode exceptionCode) {
        super(exceptionCode.getMessage());
        this.exceptionCode = exceptionCode;
    }
}
